

export class uploadFileTools
{
    constructor(page)
    {
        this.page = page;
    }

    async uploadFile({fileName})
    {
        const input = await this.page.ref.locator('input[type="file"]');
        const count = await input.count();
        if(count>0)
        {
            const filePath = 'files/data-about-user/' + fileName; 
            await input.nth(0).setInputFiles(filePath) ;
            return `Correct uploaded file at ${filePath} to the website.`;
        }
        return `Failed to upload file to the website` ;
    }
}